package com.whmall.service.crm.module.company.dao;

import com.whmall.component.mybatis.mapper.BatchMapper;
import com.whmall.service.crm.module.company.entity.CompanyDO;
import com.whmall.service.crm.module.company.entity.CompanyInformationDO;
import com.whmall.service.crm.module.company.entity.qo.CompanyInformationQO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CompanyInformationMapper extends BatchMapper<CompanyInformationDO> {

    int saveSelective(CompanyInformationDO record);

    CompanyInformationDO getById(Long id);

    List<CompanyInformationDO> getByIds(List<Long> ids);

    List<CompanyInformationDO> getByPrecursorEnterpriseId(Long precursorEnterpriseId);

    int updateByIdSelective(CompanyInformationDO record);

    int updateByIds(CompanyInformationQO qo);

    int increaseDevelopTimes(Long id);

    /**
     * 查询一个公司被多少公司关联
     * @param id 这家公司
     * @return 关联数
     */
    long selectAssociatedCountById(Long id);

    List<CompanyInformationDO> getByChildrenCompanyIds(@Param("childrenCompanyIds") List<Long> childrenCompanyIds);

    List<CompanyInformationDO> getAllAssociateCompany();

}